﻿namespace Text2Rss.Web.Code
{
	using System.IO;
	using log4net;

	/// <summary>
	/// Logging and initialization routine
	/// </summary>
	public static class Log
	{
		/// <summary>
		/// Glopal logger for all modules
		/// </summary>
		private static readonly ILog globalLog = LogManager.GetLogger(typeof(Log));

		/// <summary>
		/// Gets the global logger
		/// </summary>
		public static ILog Logger
		{
			get
			{
				return globalLog;
			}
		}

		/// <summary>
		/// Initializes Logging
		/// </summary>
		/// <param name="configFileName">config file name</param>
		public static void Initialize(string configFileName)
		{
			log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(configFileName));
		}
	}
}
